const express = require('express')
const adminModel = require('../db/modle/adminModel')
const isLoginMiddle = require('../middleware/isLoginMiddle')
const route = express.Router()
route.get('/adminList',isLoginMiddle,async (req, res) => {
    try {
        const adminListResult = await adminModel.find({}, {
            password: 0
        })
        res.send({
            code: 10000,
            msg: '查询成功',
            data: adminListResult
        })
    } catch (e) {
        console.log(e.message);
        res.send({
            code: 10001,
            message: '查询失败'+e.message,
            data: null
        })
    }

})
module.exports = route